//
//  Tooler.h
//  leo
//
//  Created by 常艳 on 15/8/26.
//  Copyright (c) 2015年 mdx. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Reachability.h"
#import "Base64.h"
#import "common.h"
#import "Task.h"
#import "LeoMsg.h"

#define Tooler_TAG @"Tooler"
@interface Tooler : NSObject
+(int)checkNetworkState;//1wifi,2gprs,3no network
+(NSString *)getUUID;
+(NSString *)getAppVersion;
+(NSString *)hashByHmac:(NSString *)key data:(NSString *)data;
+(NSString *)getSystemVersion;
+ (NSString*)getMachine;
+(NSString *)getTS;
+(NSString *)getCurrentTimeStamp;
+(NSString *)getDateTime:(NSString *)timeStamp;
+(NSString *)getHistoryDateTime:(NSString *)timeStamp;
+(NSString *)getFullName;
+(Role)getManagerType:(int)type;
+(Role)getContactType:(int)type;
+(int)getContactValue:(Role)role;
+(int)getManagerValue:(Role)role;
+ (long long) fileSizeAtPath:(NSString*) filePath;
+(NSString *)getCurrentTime;//暂时没有用
+(NSString *)getTimeStamp;
//+(void)initVersion:(NSString *)version;
+(NSString *)infoFilePath;
+(long)getCheckAppUpdateTime;
+(BOOL)updateCheckAppUpdateTime:(long)updateTime;
+(long)getCheckWatchUpdateTime;
+(BOOL)updateCheckWatchUpdateTime:(long)updateTime;
+(BOOL)updateDeviceUid:(int)deviceUid;
+(int) getGroupId;
+(int) getDeviceUid;
+(NSString *)getDocumentDirectory;
+(NSString *)strToTime:(NSString *)dateStr;
+(NSString *)strToLocalTime:(NSString *)dateStr;
+(BOOL)isDirectoryExist:(NSString *)directoryPath;
+(int)getGradeNumber:(NSString *)greadeStr;
+(NSString *)getFenceName:(int) type;
+(int)getYear:(NSString *)timeStamp;
+(int)getMonth:(NSString *)timeStamp;
+(int)getDay:(NSString *)timeStamp;
+(UIImage *)getQrcodeUrl:(NSString *)deviceUid imei:(NSString *)imei size:(CGFloat)size;
+(int)getLevelNum:(int)semp;
+(float)getProgressRate:(int)semp;
+(long)getGrowthUpdateTime;
+(BOOL)updateGrowthUpdateTime:(long)updateTime;
+(BOOL)istaskExpire:(Task *)task;
+(NSString *)getRandomCode;
+(NSString *)second2Stringformat:(NSString *)second withFormatter:(NSString *)formatter;
+(BOOL)checkStringBegin:(NSString *)str;
+(int)checkStringIllegal:(NSString *)testString ChnLength:(int)ChnLength EngLength:(int)EngLength;
+(NSString *)getIdentifier;
+ (NSString *)validateNumber:(NSString*)number;//只能输入数字
+(long)getTodayStartTs;
+(void)showHttpMsg:(SyncResult)result description:(NSString *)description msg:(NSString *)msg;
+(void)showHttpToast:(SyncResult)result description:(NSString *)description msg:(NSString *)msg parentView:(UIView *)parentView showPosition:(enum ToastShowPosition)position hideAfterDelay:(int)second;
+(NSString *)getAccountName;
+(BOOL)updateAccountName:(NSString *)accountName;

////////////UI更改
+ (NSString *)getMonthAndDay:(NSDate *)date;
+ (NSMutableAttributedString *)setFont:(UIFont *)font range:(NSRange)range text:(NSString *)string;
+ (NSString *)getDate:(NSString *)timeStamp;
+ (CGFloat)getHeightWithContent:(NSString *)content width:(CGFloat)width font:(CGFloat)font;
+ (CGFloat)getCurrentHour;
+ (CGFloat)getCurrentMinutes;

@end
